<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" type="text/css" href="../css/layout.css" />
        <link rel="stylesheet" type="text/css" href="../css/footer.css" />
    </head>
    <body>
        <script language="javascript">
            var is=false;
            var $ = function(v) { return document.getElementById(v); } 
            /******************************************************验证用户输入******************************************************/ 
            function ValidateInput(element, value) { 
                //验证密码 
                if (element == "password") { 
                    if (value.toString().length < 6) { 
                        $('tipPosition').className = 'error'; 
                        $('tipPosition').innerHTML = "密码长度过小。"; 
                        is=false;
                        return; 
                    } 
                    else { 
                        $('tipPosition').className = 'success'; 
                        $('tipPosition').innerHTML = "填写正确。"; 
                        is=true;
                    } 
                } 
            } 
            function checkmoney(money){
                var pattern=/^[0-9]+$/g;
                if(pattern.test(money)){
                    $('money').className='success';
                    $('money').innerHTML="格式正确";
                    is=true;
                }else{
                    $('money').className='error'
                    $('money').innerHTML="有非数字字符";
                    is=false;
                }
        
            }
            function InitCss() { 
                $('tipPosition').className = 'tip'; 
                $('tipPosition').innerHTML = "6~16位。"; 
            } 
            function Init(rowID){
                $(rowID).className='tip';
                $(rowID).innerHTML="格式如'2004-08-02'";
            }
            function checkdate(date,rowID){
                var pattern=/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)/;
                if(pattern.test(date))
                {
                    $(rowID).className='success';
                    $(rowID).innerHTML="格式正确";
                    is=true;
                }
                else
                { 
                    $(rowID).className='error'
                    $(rowID).innerHTML="格式错误";
                    is=false;
                }
            }
            function Evaluate(word) { 
                return word.replace(/^(?:([a-z])|([A-Z])|([0-9])|(.)){5,}|(.)+$/g, "$1$2$3$4$5").length; 
            } 
            function validatePwdStrong(value) { 
                var pwd = { 
                    color: ['#E6EAED', '#AC0035', '#FFCC33', '#639BCC', '#246626'], 
                    text: ['太短', '弱', '一般', '很好', '极佳'] 
                }; 
                function colorInit() { 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[0]; 
                    $('pwdStrong_4').style.backgroundColor = pwd.color[0]; 
                } 
                if (Evaluate(value) == 1) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[1]; 
                    $('pwdStrong_text').innerHTML = pwd.text[1]; 
                    $('pwdStrong_text').style.color = pwd.color[1]; 
                } 
                else if (Evaluate(value) == 2) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[2]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[2]; 
                    $('pwdStrong_text').innerHTML = pwd.text[2]; 
                    $('pwdStrong_text').style.color = pwd.color[2]; 
                } 
                else if (Evaluate(value) == 3) { 
                    colorInit(); 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[3]; 
                    $('pwdStrong_text').innerHTML = pwd.text[3]; 
                    $('pwdStrong_text').style.color = pwd.color[3]; 
                } 
                else if (Evaluate(value) == 4) { 
                    $('pwdStrong_1').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_2').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_3').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_4').style.backgroundColor = pwd.color[4]; 
                    $('pwdStrong_text').innerHTML = pwd.text[4]; 
                    $('pwdStrong_text').style.color = pwd.color[4]; 
                } 
            } 
      
            function checkemail(emails) 
            { 
               
                if(chekeNum(emails)==false) 
                { 
                    $('email').className = 'error'; 
                    $('email').innerHTML="邮箱地址不正确"
                    is=false;
                   
                }else{
                    $('email').className = 'success'; 
                    $('email').innerHTML="邮箱地址正确";
                    is=true;
                } 
            }
            function chekeNum(email)
            {
                 
                var pattern = /^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/;
                if(pattern.test(email))
                {
                    return true;
                }
                else
                { 
                    return false;
                }
            }
            function send_table2()
            {
                  
                if(is){
                    document.form1.action="do_add_Enterprise.action";
                    document.submit();}else{
                    alert("请完善信息");
                }
            };
              
            function findObj(theObj, theDoc){  
                var p, i, foundObj;
                if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)  {    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);    return foundObj;}
            //添加一个参与人填写行
            function AddSignRow(){ //读取最后一行的行号，存放在txtTRLastIndex文本框中 
                var txtTRLastIndex = findObj("txtTRLastIndex",document);
                var rowID = parseInt(txtTRLastIndex.value);

                var signFrame = findObj("SignFrame",document);
                //添加行
                var newTR = signFrame.insertRow(signFrame.rows.length);
                newTR.id = "SignItem" + rowID;

                //添加列:序号
                var newNameTD=newTR.insertCell(0);
                //添加列内容
                newNameTD.innerHTML = newTR.rowIndex.toString();

                //添加列:姓名
                var newNameTD=newTR.insertCell(1);
                //添加列内容
                newNameTD.innerHTML = "<table><tr><td><input name='recordListDTO.time["+rowID+"]' id='date1' type='text' size='12' onfocus='Init("+rowID+")' onblur='checkdate(this.value,"+rowID+")'/></td><td><div id='"+rowID+"'style='float:right'></div></td></tr></table>";

                //添加列:电子邮箱
                var newEmailTD=newTR.insertCell(2);
                //添加列内容
                newEmailTD.innerHTML = "<table><tr><td><input name='recordListDTO.amount["+rowID+"]' id='amount" + rowID + "' type='text' size='20' onblur='checkmoney(this.value)'/></td><td><div id='money'></div></td></tr></table>";

                //添加列:删除按钮
                var newDeleteTD=newTR.insertCell(3);
                //添加列内容
                newDeleteTD.innerHTML = "<div align='center' style='width:40px'><a href='javascript:;' onclick=\"DeleteSignRow('SignItem" + rowID + "')\">删除</a></div>";

                //将行号推进下一行
                txtTRLastIndex.value = (rowID + 1).toString() ;
            }
            //删除指定行
            function DeleteSignRow(rowid){
                var signFrame = findObj("SignFrame",document);
                var signItem = findObj(rowid,document);

                //获取将要删除的行的Index
                var rowIndex = signItem.rowIndex;

                //删除指定Index的行
                signFrame.deleteRow(rowIndex);
             
                //重新排列序号，如果没有序号，这一步省略
                for(i=rowIndex;i<signFrame.rows.length;i++){
                    signFrame.rows[i].cells[0].innerHTML = i.toString();
                }
            }//清空列表
            function ClearAllSign(){
                if(confirm('确定要清空所有参与人吗？')){
                    var signFrame = findObj("SignFrame",document);
                    var rowscount = signFrame.rows.length;

                    //循环删除行,从最后一行往前删除
                    for(i=rowscount - 1;i > 0; i--){
                        signFrame.deleteRow(i);
                    }

                    //重置最后行号为1
                    var txtTRLastIndex = findObj("txtTRLastIndex",document);
                    txtTRLastIndex.value = "1";

                    //预添加一行
                    AddSignRow();
                }
            }
        </script>
        <div ID="container">
            <div ID="header">
                <div ID="logo">
                </div>
                <div id="menu">
                    <ul>
                        <li><a href="#">首页</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">财务</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">社会环境</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">警告预警</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">客户</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">报表审核</a></li>
                        <li class="tiao"></li>
                        <li><a href="#">设置</a>
                    </ul>	
                </div>	
            </div>
            <div ID="main">
                <form  name="form1"  method="get" >
                  <div id="up1">
                      </div>
                    <div id="middle1">
                        <div class="leftbox">
                            <div class="left">
                            </div>
                            <div class="select">
                                <select name="type.type" >
                                    <s:iterator var="list" value="typeList">
                                        <option  selected="selected"><s:property value="#list.type"/>
                                        </option>
                                    </s:iterator>
                                </select>

                            </div>
                        </div>
                        <div class="rightbox">
                            <div class="righttable">

                                <table border="0" cellpadding="2" cellspacing="1" style="width:100%;hright:200px">
                                    <tr>
                                        <td nowrap align="left" width="13%" class="nav02">企业名称:</td>
                                        <td  width="60%"><input name="enterprise.name"  id="enter_name"style="width:250px;border:1px solid #0066CC;" type="text" size="40" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="nav02" nowrap align="left" width="13%">企业地址:</td>
                                        <td  width="60%"><input name="enterprise.address"  style="width:250px;border:1px solid #0066CC;" type="text" size="40" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td  class="nav02"nowrap align="left" width="13%">登陆账号：</td>
                                        <td  class="nav02"width="60%"><input name="enterprise.username" class="text" style="width:250px;border:1px solid #0066CC;" type="text" size="40" />
                                        </td>

                                    </tr>
                                    <tr>
                                        <td  class="nav02"nowrap align="left" width="13%">登陆密码:</td>
                                        <td  width="61%"><input name="enterprise.password"  style="width:250px;   border:1px solid #0066CC;" type="password" size="40" 
                                                                maxlength="16" onfocus="InitCss();" 
                                                                onblur="ValidateInput('password',this.value)" onkeydown="validatePwdStrong(this.value);"/>
                                        </td>
                                        <td> 
                                            <div id="tipPosition"> 
                                            </div> 
                                        </td> 
                                        <td> 
                                            <table id="pwdStrong_color"> 
                                                <tr> 
                                                    <td id="pwdStrong_1"> 
                                                    </td> 
                                                    <td id="pwdStrong_2"> 
                                                    </td> 
                                                    <td id="pwdStrong_3"> 
                                                    </td> 
                                                    <td id="pwdStrong_4"> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                        </td> 
                                        <td> 
                                            <div id="pwdStrong_text"> 
                                            </div> 
                                        </td> 
                                    </tr>
                                    <tr>
                                        <td  class="nav02"nowrap align="left" width="13%">联系邮箱：</td>
                                        <td  width="61%"><input name="enterprise.email" style="width:250px;border:1px solid #0066CC;" type="text" size="40" onblur="checkemail(this.value)"/>
                                        </td>
                                        <td id="email">

                                        </td>
                                    </tr>


                                </table>
                            </div>
                        </div>
                        <div class="buttombox">
                            <div style="margin-top: 30; font-family:Arial, Helvetica, sans-serif;float:center;font-size: 26;">还贷计划</div>
                            <div style="margin-top: 5;margin-left: 180;float:left;clear:both">
                                <table Style="border: 0; width:560px" cellpadding="2"cellspacing="1">
                                    <tr>
                                        <td Style="float:right;width:560px;">
                                            <input type="button" name="Submit" value="添加计划" class="button" onclick="AddSignRow()"/>　
                                        </td>
                                    </tr>

                                </table>
                            </div>
                            <div style="margin-top: 0;margin-left:10 ;margin-bottom: 10;float:center;">
                                <div>
                                    <table   width="627" border="1px #0066cc solid" cellpadding="2" cellspacing="1" id="SignFrame">
                                        <tr id="trHeader">
                                            <td width="27" >序号</td>
                                            <td width="300" >计划还贷时间</td>
                                            <td width="300" >计划还贷金额</td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                    <input name='txtTRLastIndex' type='hidden' id='txtTRLastIndex' value="1" />
                                </div>
                            </div>
                  
                        </div>
                        <div class="buttombox">
                            <table id="my_table"Style="border:0; height:80%;width:80%" cellpadding="2"cellspacing="1">
                                <tr>
                                    <td nowrap align="left">报表提交时间从</td>
                                    <td><select name="beginYear" >
                                            <option  selected="selected">2011</option>
                                            <option>2012</option>
                                            <option>2013</option>
                                            <option>2014</option>
                                            <option>2015</option>
                                            <option>2016</option>
                                            <option>2017</option>
                                            <option>2018</option>
                                            <option>2019</option>
                                            <option>2020</option>
                                        </select>
                                        <font font-family:Arial size:13>年
                                        </font>
                                        <select name="beginMonth" >
                                            <option  selected="selected">1</option>
                                            <option>2</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                            <option>6</option>
                                            <option>7</option>
                                            <option>8</option>
                                            <option>9</option>
                                            <option>10</option>
                                            <option>11</option>
                                            <option>12</option>

                                        </select>
                                        <font font-family:Arial size:13>月
                                        </font>

                                        <font font-family:Arial size:13>7日
                                        </font>
                                    </td>

                                    <td nowrap align="left">到</td>
                                    <td><select name="endYear" >
                                            <option  selected="selected">2011</option>
                                            <option>2012</option>
                                            <option>2013</option>
                                            <option>2014</option>
                                            <option>2015</option>
                                            <option>2016</option>
                                            <option>2017</option>
                                            <option>2018</option>
                                            <option>2019</option>
                                            <option>2020</option>
                                        </select>
                                        <font font-family:Arial size:13>年
                                        </font>
                                        <select name="endMonth" >
                                            <option  selected="selected">1</option>
                                            <option>2</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                            <option>6</option>
                                            <option>7</option>
                                            <option>8</option>
                                            <option>9</option>
                                            <option>10</option>
                                            <option>11</option>
                                            <option>12</option>

                                        </select>
                                        <font font-family:Arial size:13>月
                                        </font>

                                        <font font-family:Arial size:13>7日
                                        </font>
                                    </td>

                                </tr>
                                <tr>
                                    <td colspan="2" align="center" height="50px">
                                        <input type="submit" name="submit" value="保存" class="button" onclick="send_table2()"/>
                                        </td>
                                      <td colspan="2" align="center" height="50px">
                                        <input type="reset" name="submit2" value="重置" class="button" />
                                    </td>
                                </tr>
                            </table>

                        </div>     
                  </div>
                    <div id="buttom1">
                        </div>
                    <div ID="footer">
                        <table id="footer-container" border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
                            <tbody>
                                <tr>
                                    <td>
                                        <table class="foot-links" border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tbody>
                                                <tr>
                                                    <td><a href="http://www.citigroup.com/" target="_blank">Citigroup.com</a></td>
                                                    <td><ul>
                                                            <li><a href="http://www.citi.com.cn/html/cn/about_us/citi_group.html">关于花旗</a></li>
                                                            <li><a href="http://www.citi.com.cn/html/cn/HR/HR.html" target="_blank">加入花旗</a></li>
                                                            <li><a href="https://www.citibank.com.cn/CNGCB/APPS/portal/loadPage.do?path=/info/det/atm_network.htm">分行位置</a></li>
                                                            <li><a href="http://www.citibank.com.cn/chinese/footer/sitemap.htm">网站导航</a></li>
                                                            <li><a href="http://www.citibank.com.cn/chinese/footer/privacy.htm">隐私保护</a></li>
                                                            <li><a href="http://www.citibank.com.cn/chinese/footer/terms.htm">条件与条款</a></li>
                                                        </ul>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tbody>
                                                <tr>
                                                    <td class="footer-logo"><img src="../image/logo_footer.gif" alt="Citi" title="Citi"></td>
                                                    <td class="foot-gray" align="right">沪ICP备05047918<br>
                                                        Copyright ? 2011 Citigroup Inc.</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </form>
            </div>

        </div>
    </body>
</html>
